<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSystemGroupsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_groups', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')          ->default('')  ->comment('拼团活动名称');
            $table->timestamp('start_time') ->nullable()        ->comment('开始时间');
            $table->timestamp('end_time')   ->nullable()        ->comment('结束时间');
            $table->integer('time_limit')   ->default(0)   ->comment('成团时效');
            $table->integer('require_num')  ->default(0)   ->comment('成团人数');
            $table->string('activity_group') ->default('all_user') ->comment('活动对象');
            $table->tinyInteger('status')   ->default(0)    ->comment('状态');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::dropIfExists('system_groups');
    }
}
